import axios from "../axios";

export default {
    login: (data) => {
        return axios({
            method: "post",
            url: "/api/users/login",
            data
        })
    },
    userlist: (params) => {
        return axios({
            method: "get",
            url: "/api/users/userlist",
            headers: {
                token: window.localStorage.getItem("token")
            },
            params
        })
    },
    deleteuser: (data) => {
        return axios({
            method: "post",
            url: "/api/users/deluser",
            headers: {
                token: window.localStorage.getItem("token")
            },
            data
        })
    },
    adduser: (data) => {
        return axios({
            method: "post",
            url: "/api/users/register",
            headers: {
                token: window.localStorage.getItem("token")
            },
            data
        })
    },
    insertmany: (data) => {
        return axios({
            method: "post",
            url: "/api/users/insertmany",
            headers: {
                token: window.localStorage.getItem("token")
            },
            data
        })
    }
}